function answer = boltzman(individuos, k, fitness, generation)
    
    T = 20/generation;
    
    indNumber = rows(individuos);
    
    for i=1:indNumber
        numerador(i) = exp(fitness(i)/T);
    end
    
    denominador = sum(numerador)/indNumber;
    
    for i=1:indNumber
        prob(i) = numerador(i)/denominador;
        probabilities(i) = sum(prob);
    end
    
%   probabilities = sort(probabilities, 'ascend');
    
    for i=1:k
        r=rand(1)*probabilities(indNumber);
        l=1;
        while probabilities(l)<r
            l=l+1;
        end
        individuosS(i,:) = individuos(l,:); 
    end    
    
    answer = individuosS;
end

